Merge "Normalize `input[type="search"]`"
[lhc/web/wiklou.git] / includes / context / RequestContext.php
index c8b8108..ba54603 100644 (file)
@@ -23,6 +23,7 @@
  */
 
 use MediaWiki\Logger\LoggerFactory;
+use MediaWiki\MediaWikiServices;
 
 /**
  * Group all the pieces relevant to the context of a request into one instance
@@ -496,9 +497,8 @@ class RequestContext implements IContextSource, MutableContext {
         * Resets singleton returned by getMain(). Should be called only from unit tests.
         */
        public static function resetMain() {
-               if ( !( defined( 'MW_PHPUNIT_TEST' ) || defined( 'MW_PARSER_TEST' ) ) ) {
-                       throw new MWException( __METHOD__ . '() should be called only from unit tests!' );
-               }
+               // TODO: manage service instances in MediaWikiServices
+               MediaWikiServices::failUnlessBootstrapping( __METHOD__ );
                self::$instance = null;
        }